Nested VMX: CR emulation fix up
authorYang Zhang <yang.z.zhang@Intel.com>
Fri, 6 Dec 2013 10:08:20 +0000 (11:08 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 6 Dec 2013 10:08:20 +0000 (11:08 +0100)
commitef17e127c4111d8e01fe208495d83d15e8834cce
treeaab598d916a6b8ea4ace18b4ebe0bc711d625ebf
parentd65da94e03935878d84818a6890403997027cfa4
Nested VMX: CR emulation fix up

This patch fixs two issues:
1. The CR_READ_SHADOW should only cover the value that L2 wirtes to
CR when L2 is running. But currently, L0 wirtes wrong value to
it during virtual vmentry and L2's CR access emualtion.

2. L2 changed cr[0/4] in a way that did not change any of L1's shadowed
bits, but did change L0 shadowed bits. In this case, the effective cr[0/4]
value that L1 would like to write into the hardware is consist of
the L2-owned bits from the new value combined with the L1-owned bits
from L1's guest cr[0/4].

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/include/asm-x86/hvm/nestedhvm.h
xen/include/asm-x86/hvm/vcpu.h
xen/include/asm-x86/hvm/vmx/vvmx.h